class sound : public base_object
{
public:
int total_time;
LPDIRECTSOUNDBUFFER buf;
LPDIRECTSOUND3DBUFFER buf3d;
sound()
{ buf=0; buf3d=0; total_time=0; };
virtual ~sound()
{ reset(); };
void reset()
{
if (buf3d) buf3d->Release(); buf3d=0;
if (buf) buf->Release(); buf=0;
total_time=0;
}
int load_wav(char *filename);
sound *clone();
};
Member | Type | Description |
---|---|---|
total_time | int | the sound length in ms |
buf | LPDIRECTSOUNDBUFFER | the DirectX sound buffer |
buf3d | LPDIRECTSOUND3DBUFFER | the DirectX sound buffer 3D |
This class implements raw sound data. The sound can be loaded from a .wav
file.
For playing multiple instances of the same sound, you must clone it and play the
clones.